/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.client.virtual.model;

import offset.nodes.Constants;
import offset.nodes.client.model.TreeNodeUserObject;
import offset.nodes.client.virtual.model.jcr.QName;
import offset.nodes.client.virtual.model.jcr.nodetype.PropertyDefinition;


public class SchemaProperty extends SchemaItem implements TreeNodeUserObject {
    private QName name;
    private PropertyDefinition property;
    
    public SchemaProperty(QName name, PropertyDefinition property) {
        super(name);
        this.setProperty(property);
    }
    
    public PropertyDefinition getProperty() {
        return property;
    }
    
    public void setProperty(PropertyDefinition property) {
        this.property = property;
    }
    
    public static SchemaProperty newProperty() {
        QName name = new QName(Constants.URI_NODES_DATA, "");
        
        PropertyDefinition property = new PropertyDefinition();
        
        SchemaProperty definition = new SchemaProperty(name, property);
        
        return definition;
    }

    public String getType() {
        return SchemaItem.TYPE_PROPERTY;
    }
    
    
}
